function myNew(Func, ...args) {
  const obj = Object.create(Func.prototype);
  const res = Func.call(obj, ...args);
  return res instanceof Object ? res : obj;
}

const func = function (name) {
  this.name = name;
};

// const res = func.apply({ name: "zxc" });
// console.log(res);

const o = myNew(func, "kaho");
console.log(o);
